﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="BlogLite"
    targetNamespace="http://tempuri.org/BlogLite.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/BlogLite.xsd"
    xmlns:mstns="http://tempuri.org/BlogLite.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
    <!-- simple element definitions -->
    <xs:element name="postId" type="xs:positiveInteger" />
    <xs:element name="userId" type="xs:positiveInteger" />
    <xs:element name="postDate" type="xs:dateTime" />
    <xs:element name="subject" type="xs:normalizedString" />
    <xs:element name="content" type="xs:string" />
    <xs:element name="lastModified" type="xs:dateTime" />
    <xs:element name="tagName" type="xs:normalizedString" />
    <xs:element name="title" type="xs:normalizedString" />
    <xs:element name="name" type="xs:normalizedString" />
    <xs:element name="email" type="xs:normalizedString" />
    <xs:element name="gravatarHash" type="xs:normalizedString" />
    <xs:element name="website" type="xs:normalizedString" />
    <xs:element name="comment" type="xs:string" />

    <!-- complex element definitions -->
    <xs:element name="tags">
      <xs:complexType>
        <xs:sequence>
          <xs:element ref="tagName" />
        </xs:sequence>
      </xs:complexType>
    </xs:element>

    <xs:element name="comments">
      <xs:complexType>
        <xs:sequence>
          <xs:element ref="title" />
          <xs:element ref="name" />
          <xs:element ref="email" />
          <xs:element ref="gravatarHash" />
          <xs:element ref="website" />
          <xs:element ref="comment" />
        </xs:sequence>
      </xs:complexType>
    </xs:element>

    <xs:element name="post">
      <xs:complexType>
        <xs:sequence>
          <xs:element ref="postId" />
          <xs:element ref="userId" />
          <xs:element ref="postDate" />
          <xs:element ref="subject" />
          <xs:element ref="content" />
          <xs:element ref="lastModified" />
          <xs:element ref="tags" />
          <xs:element ref="comments" />
        </xs:sequence>
      </xs:complexType>
    </xs:element>
  
</xs:schema>